<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/1
 * Time: 16:13
 */
namespace vendor\user;
class user
{
    private static $usernum;
    public function __construct()
    {
        self::$usernum++;
        echo '<br />创建对象<br />';
    }
    public function __destruct()
    {
        echo '<br />删除对象<br />';
        self::$usernum--;
    }
    //注册
    public function register(){
        echo '注册';
    }
    public function login(){
        echo '登录';
    }
    public function updatepwd(){
        echo '修改密码';
    }
    public function level(){
        echo '我是普通用户';
    }
    //获取在线人数
    public static function onlinenum(){
        return self::$usernum;
    }
}